import request from '@/utils/request'

/**
 * 新增试卷
 * @param {paperCode,paperName,paperCategory,totalPoint,passPoint,answerTime} data 
 * @returns 
 */
export function NewPaper(data) {
    return request({
        url: '/drill/paper',
        method: 'post',
        data: data
    })
}

/**
 * 新增试卷题目
 * @param {paperId,questionId} data 
 * @returns 
 */
export function NewPaperTopics(data) {
    return request({
        url: '/drill/examQuestion',
        method: 'post',
        data: data
    })
}

/**
 * 试卷列表
 * @param {*} query 
 * @returns 
 */
export function PaperList(query) {
    return request({
        url: '/drill/paper/list',
        method: 'get',
        params: query
    })
}

/**
 * 试卷修改
 * @param {paperId,status} data 
 * @returns 
 */
export function Issue(data) {
    return request({
        url: '/drill/paper',
        method: 'put',
        data: data
    })
}

/**
 * 试卷删除
 * @param {paperId} paperId 
 * @returns 
 */
export function PaperDelete(paperId) {
    return request({
        url: '/drill/paper/' + paperId,
        method: 'delete',
    })
}

/**
 * 试卷详情
 * @param {paperId} paperId 
 * @returns 
 */
export function PaperDetails(paperId) {
    return request({
        url: '/drill/examQuestion/selectAllQuestions/' + paperId,
        method: 'get',
    })
}

/**
 * 提交试卷答案
 * @param {*} data 
 * @returns 
 */
export function SubmitPaperAnswer(data) {
    return request({
        url: '/drill/answer/insertAllAnswers',
        method: 'post',
        data: data
    })
}



